import { ClientOpcode } from "@runtime/generate/message/ClientOpcode";
import NeolithExamMessageHandler from "@runtime/module/Handler/NeolithExamMessage/NeolithExamMessage";
import NeolithTrackEnterMessageHandler from "@runtime/module/Handler/NeolithTrackEnterMessage/NeolithTrackUpdateMessage";
import NeolithTrainStepMessageHandler from "@runtime/module/Handler/NeolithTrainStepMessage/NeolithTrainStepdateMessage";
import VehicleControlInfoMessageHandler from "@runtime/module/Handler/VehicleControlInfo/StructureAdapterUpdateMessage";
import NeolithTrackApolloVehicleInfoMessageHandler from "@runtime/module/Handler/NeolithTrackApolloVehicleInfoMessage/NeolithTrackApolloVehicleInfoMessage";
import WebSocketComponent from "@runtime/module/WebSocket/WebSocketComponent";
import NeolithTrainMessageHandler from "@runtime/module/Handler/NeolithTrainMessage/NeolithTrainMessage";
import NeolithVehicleWarnUpdateMessageHandler from "@runtime/module/Handler/NeolithVehicleWarn/NeolithVehicleWarn";


export default class ClientMessageHandlerLoader {
  private static instance: ClientMessageHandlerLoader = new ClientMessageHandlerLoader();
  /**
   * 请求处理加载器
   */
  public static get Default(): ClientMessageHandlerLoader {
    return this.instance;
  }

  public Load(): void {
    WebSocketComponent.Default.Register(ClientOpcode.VehicleControlInfoMessage, new VehicleControlInfoMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.NeolithTrainStepMessage, new NeolithTrainStepMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.NeolithExamMessage, new NeolithExamMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.NeolithTrackEnterMessage, new NeolithTrackEnterMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.NeolithTrackApolloVehicleInfoMessage, new NeolithTrackApolloVehicleInfoMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.NeolithVehicleWarnMessage, new NeolithVehicleWarnUpdateMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.NeolithTrainMessage, new NeolithTrainMessageHandler());
  }
}